package vn.wallet.app.service.impl;

// Generated Oct 23, 2012 10:05:44 PM by Hibernate Tools 3.4.0.CR1

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.wallet.app.dao.IProfileDAO;
import vn.wallet.app.domain.Profile;
import vn.wallet.app.service.IProfileService;

@Transactional
@Service
public class ProfileService implements IProfileService {

	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(ProfileService.class);

	@Autowired
	IProfileDAO profileDAO;

	@Override
	public Profile getById(int id) throws Exception {
		return profileDAO.getById(id);
	}

	@Override
	public void delete(Profile obj) throws Exception {
		profileDAO.delete(obj);
	}

	@Override
	public void delete(int id) throws Exception {
		profileDAO.delete(id);
	}

	@Override
	public void update(Profile obj) throws Exception {
		profileDAO.update(obj);
	}

	@Override
	public void save(Profile obj) throws Exception {
		profileDAO.save(obj);
	}

	@Override
	public List<Profile> getAll() throws Exception {
		return profileDAO.getAll();
	}

	@Override
	public List<Profile> getAllByUserId(int userId) throws Exception {
		return profileDAO.getAllByUserId(userId);
	}

	@Override
	public List<?> findByExample(Profile obj) throws Exception {
		return profileDAO.findByExample(obj);
	}

	public IProfileDAO getProfileDAO() {
		return profileDAO;
	}

	public void setProfileDAO(IProfileDAO profileDAO) {
		this.profileDAO = profileDAO;
	}

}
